package com.jiangyg.devtools.ui.table.cell;

import com.intellij.ui.components.JBTextField;

import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

/**
 * 类描述：选择单元格渲染器
 *
 * @author jiangyg
 * @date 2023-08-29
 */
public class JavaBaseTypeComboBoxCellRenderer implements TableCellRenderer {

    @Override
    public Component getTableCellRendererComponent(JTable table,
                                                   Object value,
                                                   boolean isSelected,
                                                   boolean hasFocus,
                                                   int row, int column) {
        final String content = String.valueOf(value);
        final JBTextField textField = new JBTextField();
        textField.setText(content);
        textField.setToolTipText(content);

        return textField;
    }

}
